<?php

namespace App\Models\Strator;

use App\Models\Traits\DateTimeTrait;
use App\Models\Traits\ModelSearchTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class StratorLoginLog extends Model
{
    use SoftDeletes, DateTimeTrait, ModelSearchTrait;

    protected $dateFormat = 'Y-m-d H:i:s';
    protected $guarded = [];

    //
    public function searchConditions():array{
        return [
            ['strator_id','='],
            ['ip','='],
            ['referer','like'],
            ['user_agent','like'],
            ['client_type','like'],
            ['login_result','='],
            ['failed_reason','like'],
            ['failed_account','like'],
        ];
    }

    //
    public function strator(){
        return $this->belongsTo(Strator::class,'strator_id','id');
    }


}
